<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript">
	function selectall() {

		var allbox = document.getElementsByName('ids');

		if (document.getElementById('checkcan').checked == true)

			document.getElementById('checkcan').checked = false;

		for (i = 0; i < allbox.length; i++) {

			if (allbox[i].type == "checkbox" && allbox[i] != null)

				allbox[i].checked = true;

		}

	}

	function cancelselectall() {

		var allbox = document.getElementsByName('ids');

		if (document.getElementById('checkall').checked == true)

			document.getElementById('checkall').checked = false;

		for (i = 0; i < allbox.length; i++) {

			if (allbox[i].type == "checkbox" && allbox[i] != null)

				allbox[i].checked = false;

		}

	}

	function selectfan() {

		if (document.getElementById('checkall').checked == true)

			document.getElementById('checkall').checked = false;

		if (document.getElementById('checkcan').checked == true)

			document.getElementById('checkcan').checked = false;

		var allbox = document.getElementsByName('ids');

		for (i = 0; i < allbox.length; i++) {

			if (allbox[i].type == "checkbox" && allbox[i] != null) {

				if (allbox[i].checked == true)

					allbox[i].checked = false;

				else

					allbox[i].checked = true;

			}

		}

	}
	
	
	
</script>

</head>
<body>
<div id="main">
<div>
<p>查看员工信息</p>
<form action="hremAction!searchByName" method="post"><input
	type="text" name="sname" /> <input type="submit" value="查找" />通过姓名</form>
<form action="hremAction!searchById" method="post"><input
	type="text" name="id" /><input type="submit" value="查找" />通过ID </form>
<form action="hremAction!searchByPhone" method="post"><input
	type="text" name="sphone" /><input type="submit" value="查找" />通过电话号码 </form>
<a href="employeesearch.jsp">高级查找</a>
<div>
<form action="hremAction!deletese" method="post">
<table>
	<tr>
		<td><input type="checkbox" id="checkall"></input></td>
		<td>ID</td>
		<td>姓名</td>
		<td>性别</td>
		<td>员工帐号</td>
		<td>年龄</td>
		<td>电话</td>
		<td>是否删除</td>
		<td>查看更多</td>
	</tr>

	<s:iterator value="employees">

		<tr>
			<td><input type="checkbox" name="ids"
				value="<s:property value="id" />"></input></td>
			<td><s:property value="id" /></td>
			<td><s:property value="name" /></td>
			<td><s:property value="sex" /></td>
			<td><s:property value="employeeacc" /></td>
			<td><s:property value="age" /></td>
			<td><s:property value="telphone" /></td>
			<td><a href="hremAction!delete?id=<s:property value="id" />">delete</a></td>
			<td><a href="hremAction!showem?id=<s:property value="id" />">more</a></td>

		</tr>



	</s:iterator>


</table>
  <p> <span>全选</span>

      <input id="checkall" type="checkbox" class="checkbox" onclick="selectall()"/>

      <span>取消全选</span>

      <input id="checkcan" type="checkbox" class="checkbox" onclick="cancelselectall()"/>

      <span>反转</span>

      <input id="checkcfan" type="checkbox" class="checkbox" onclick="selectfan()"/>

    </p>
<input type="submit" value="删除所选" />
</form>
<s:if test="%{ids!=null}">
	 id为<s:property value="ids" />的员工已经被删除
	</s:if>

</div>
<a href="hremAction!employeeList">refrash</a> <a
	href="hremAction!employeeListPp">pre</a> <a
	href="hremAction!employeeListPn">next</a> 
	<s:debug></s:debug></div>
	
</body>
</html>